/*
 * bhal_flash_memory.h
 *
 *  Created on: 12/03/2010
 *      Author: gustavo
 */

#ifndef BHAL_FLASH_MEMORY_H_
#define BHAL_FLASH_MEMORY_H_


// *********************** DEFINITIONS *************************

typedef U_BASE_TYPE bhal_flash_memory_MemoryId;
typedef U32 bhal_flash_memory_Address;
typedef U32 bhal_flash_memory_DataSize;

// *********************** PROTOTYPES **************************

extern void bhal_flash_memory_init(void);
extern U_BASE_TYPE bhal_flash_memory_getNumberOfMemories(void);
extern bhal_flash_memory_DataSize bhal_flash_memory_getPageSize(bhal_flash_memory_MemoryId memoryId);
extern bhal_flash_memory_DataSize bhal_flash_memory_getFlashSize(bhal_flash_memory_MemoryId memoryId);
extern U8 bhal_flash_memory_readByte(bhal_flash_memory_MemoryId memoryId, bhal_flash_memory_Address address);
extern void bhal_flash_memory_read(bhal_flash_memory_MemoryId memoryId, U8 *data, bhal_flash_memory_DataSize size, bhal_flash_memory_Address address);
extern void bhal_flash_memory_writeByte(bhal_flash_memory_MemoryId memoryId, U8 data, bhal_flash_memory_Address address);
extern void bhal_flash_memory_write(bhal_flash_memory_MemoryId memoryId, U8 *data, bhal_flash_memory_DataSize size, bhal_flash_memory_Address address);
extern void bhal_flash_memory_erasePage(bhal_flash_memory_MemoryId memoryId, bhal_flash_memory_Address address);
extern void bhal_flash_memory_eraseFlash(bhal_flash_memory_MemoryId memoryId);


#endif /* BHAL_FLASH_MEMORY_H_ */
